package com.mdlib.helper.ui.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ljlib.core.util.common.TimeUtils;
import com.ljlib.help.R;
import com.mdlib.helper.model.entity.MessageEntity;

import java.util.List;

/**
 * 作者：HQY on 16/11/30 17:04
 * 邮箱：hqy_xz@126.com
 */

public class RushMessageAdapter extends BaseQuickAdapter<MessageEntity> {

    public RushMessageAdapter(List<MessageEntity> data) {
        super(R.layout.item_rush_message, data);
    }

    @Override
    protected void convert(BaseViewHolder baseViewHolder, MessageEntity message) {

        baseViewHolder.setText(R.id.tv_message_title, message.getTitle())
                .setText(R.id.tv_message_content, message.getContent())
                .setText(R.id.tv_message_time, TimeUtils.milliseconds2String(Long.valueOf(message.getCreated_at()) * 1000));
    }
}
